//
//  NetworkManager.h
//  ZhiHuDaily
//
//  Created by 吴宜昊 on 2022/2/4.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

/** 请求成功的Block */
typedef void(^RequestSuccess) (id responseObject);

/** 请求失败的Block */
typedef void(^RequestFailed) (NSError *error);

@interface NetworkManager : AFHTTPSessionManager

+(instancetype) shared;
- (instancetype) initWithBaseURL:(nullable NSString *) strURL;

+ (void) GET:(NSString *)URL
               parameters:(nullable NSDictionary *)parameters
                  success:(RequestSuccess)success
     failure:(RequestFailed)failure;

+ (void) POST:(NSString *) URL
               parameters:(nullable NSDictionary *)parameters
                  success:(RequestSuccess)success
      failure:(RequestFailed)failure;
@end

NS_ASSUME_NONNULL_END
